package pl.prv.polanie.client.model;

import pl.prv.polanie.client.dto.CSSemesterDTO;
import pl.prv.polanie.client.dto.CSStudiesTypeDTO;

/**
 * Klasa przechowująca context.
 * 
 * @author Janusz Prokulewicz
 * Created: Jun 19, 2008
 */
public class ContextSettings {
	
	/**
	 * Semestr, na ktorym wykonywane sa wszystkie operacje w aplikacji
	 */
	static long semesterID = -1;
	
	private static boolean guiDebugMode = true;
	
	private static boolean firebugDebugMode = true;
	
	private static String signedInAdminUserLogin = null; 
		//"Janusz Prokulewicz";
	
	
	public static long getSemesterID() {
		return semesterID;
	}

	
	public static void setSemesterID(long semesterID) {
		ContextSettings.semesterID = semesterID;
	}
	
	
	public static int getDayWidthInPixels() {
		CSSemesterDTO semesterDTO = Cache.getCSSemesterDTOByID(semesterID);
		CSStudiesTypeDTO studiesTypeDTO = Cache.getCSStudiesTypeDTOByID(semesterDTO.getStudiesTypeID());
		
		if (studiesTypeDTO.getId() == 2) {
			//2 => zaoczne
			//1 => dzienne, 3 => wieczorowe
			return 70;
		}
		return 200;
	}

	public static String getSignedInAdminUserLogin() {
		return signedInAdminUserLogin;
	}

	public static void setSignedInAdminUserLogin(String signedInAdminUserLogin) {
		ContextSettings.signedInAdminUserLogin = signedInAdminUserLogin;
	}
	
	public static boolean isAdminUserSignedIn() {
		return (signedInAdminUserLogin != null);
	}

	
	
	
	public static boolean isGuiDebugMode() {
		return guiDebugMode;
	}

	public static void setGuiDebugMode(boolean guiDebugMode) {
		ContextSettings.guiDebugMode = guiDebugMode;
	}

	public static boolean isFirebugDebugMode() {
		return firebugDebugMode;
	}

	public static void setFirebugDebugMode(boolean firebugDebugMode) {
		ContextSettings.firebugDebugMode = firebugDebugMode;
	}
	

	
	
	
	
}
